﻿using System;
using System.Windows.Forms;

namespace TextEditor
{
    

    public class A_Redo : A_Action
    {
        public A_Redo()
        {
            base.HotKey = Keys.Control | Keys.Y;
        }

        public override string ActionName()
        {
            return "redo";
        }

        public override bool Execute()
        {
            return base.myOwnerDocument._Redo();
        }

        public override string GetText()
        {
            if (this.isEnable())
            {
                A_Action action = (A_Action) base.myOwnerDocument.RedoList[base.myOwnerDocument.RedoList.Count - 1];
                return ("重复 " + action.UndoName());
            }
            return "无可重复的操作";
        }

        public override bool isEnable()
        {
            return ((base.myOwnerDocument.CanModify() && (base.myOwnerDocument.RedoList.Count > 0)) && base.isEnable());
        }
    }
}

